<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>创建微讯</title>
<link type="image/x-icon" rel="Shortcut Icon"
	href="<%=basePath%>Images/favicon.ico" />
<style type="text/css">
@import "<%=basePath%>CSS/Yiian_Style.css";
</style>
<link type="text/css" rel="stylesheet"
	href="<%=basePath%>CSS/Yiian_Include.css" />
<link type="text/css" rel="stylesheet"
	href="<%=basePath%>CSS/Yiian_Pefect.css" />
			<link type="text/css" rel="stylesheet"
		href="<%=basePath%>CSS/common/common.css" />
<script type="text/javascript" src="<%=basePath%>JS/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="<%=basePath%>JS/common/valid.js"></script>
<script type="text/javascript">

	//边框 变红/褪色 函数
	function remind(_target,_boolean){
		if(!_boolean){
			_target.removeClass("iconok");
			_target.addClass("iconerror");
		}else{
			_target.removeClass("iconerror");
			_target.addClass("iconok");
		}
	}
	$(function(){

		 $("#name,#label,#introduction").bind("blur keyup",function(){
		 	remind($(this).next("img"), $(this).val().length > 2);
		 });

		 $("#path").bind("blur keyup",function(){
			 	var result = /\W/.test($(this).val());
			 	remind($(this).next("img"), $(this).val().length > 2 && !/\W/.test($(this).val()) );
		 });
		 
		 $("#doc").bind("blur keyup",function(){
		 		remind($(this).next("img"), validExt($(this).val()));
		 });

		$("#nextbtn").click(function(){
			var result = true;
			$("input", "#bechecked").each(function(){
				$(this).trigger("blur");
				if($(this).next() && $(this).next().attr("class") && $(this).next().attr("class").indexOf("iconerror") >=0){
					result = false;
					return ;
				}

			});

			if(!result){
				alert("请按要求填写表单内容！");
				return;
			}

			var params = {};
			params["weixun.name"] = $("#name").val() ;
			params["weixun.introduction"] = $("#introduction").val();
			params["weixun.path"] = $("#path").val();
			
			$.ajax({
				type : "post",
				url : "<%=basePath%>Right/create.action",
				dataType : "json",
				data:params,
				success : function(_result) {
					if(_result){
						if("undefinded" != _result.weixunid){
							$("#weixunid").val(_result.weixunid);
							$("#fileupload").submit();
						}
					}
				},
				error:function(){
					alert("注册失败！");
				}
			});
			
			
			
		});

	})


</script>
</head>
<body>



<div class="header"><a class="logo" href="http://www.wixun.com"
	title="微讯"><img src="<%=basePath%>Images/Logo.png" /></a></div>

<div class="maintop">&nbsp;</div>

<div class="main">
<div class="left">&nbsp;</div>
<div class="center">
<div class="tishi">你正在使用&nbsp;<span class="blue">${sessionScope.user.username }</span>&nbsp;这个帐号&nbsp;&nbsp;|&nbsp;&nbsp;<a
	class="blue" href="<%=basePath%>">换个帐号？</a></div>
<div class="jingdu3 jingdu">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
	class="bai"><strong>1.创建微讯</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.基本资料&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.信息验证&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.账户审核&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<div>
<ul class="info" id="bechecked">
	<li class="zhu">为必填项</li>
	<li class="xing text"><span class="da">微讯名称：</span><input
		type="text" class="infotxt txt" id="name" name="name" value="" />&nbsp;&nbsp;<img height="15" width="15" class="wbIcon" src="<%=basePath%>Images/common/transparent.gif"></li>
	<li class="xing text"><span class="da">微讯地址：http://www.wixun.com&nbsp;/&nbsp;</span><input
		type="text" class="dizhitxt infotxt txt" id="path" name="" value="" />&nbsp;&nbsp;<img height="15" width="15" class="wbIcon" src="<%=basePath%>Images/common/transparent.gif"></li>
	<li class="xing text"><span class="da">微讯标签：</span><input
		type="text" class="infotxt txt" id="label" name="" value="" />&nbsp;&nbsp;<img height="15" width="15" class="wbIcon" src="<%=basePath%>Images/common/transparent.gif"></li>
	<li class="xing jianshao"><span class="shuoming da">&nbsp;&nbsp;&nbsp;微讯简介：</span><textarea
		class="jianjie" id="introduction" name=""></textarea>&nbsp;&nbsp;<img height="15" width="15" class="wbIcon" src="<%=basePath%>Images/common/transparent.gif"></li>
	<li class="tubiao xing text">
		<form action="<%=basePath%>upload/uploadWeixunLogo.action" method="post" id="fileupload"
			enctype="multipart/form-data">
			<span class="da">微讯图标：</span><input type="file" size="25"
			 name="doc"  id="doc"/>&nbsp;&nbsp;&nbsp;&nbsp;<img height="15" width="15" class="wbIcon" src="<%=basePath%>Images/common/transparent.gif">
			 <input type="hidden" name="path" value="Right/microData.jsp" />
			 <input type="hidden" name="weixun.id" id="weixunid" />
			 </form>
			
	</li>
	<li class="icotu"><img src="<%=basePath%>Images/ico11.jpg" /></li>
	<li class="icotu text"><input type="checkbox" class="" id=""
		name="" value="Y" checked="checked" />&nbsp;我看过并同意<a
		class="xieyi blue" href="#" target="_blank">《微讯网络服务协议》</a></li>
	<li class="anniu"><input type="button" class="nextbtn"
		id="nextbtn" name="" value="" /></li>
</ul>
</div>
</div>
<div class="right">&nbsp;</div>
</div>

<div class="mainbottom">&nbsp;</div>

<div class="copyright"><a class="links" href="#" target="_blank">帮助信息</a>-<a
	class="links" href="#" target="_blank">联系我们</a>-<a class="links"
	href="#" target="_blank">意见建议</a>-<a class="links" href="#"
	target="_blank">举报</a>-<a class="links" href="#" target="_blank">微讯首页</a><br />
Copyright&nbsp;&copy;&nbsp;2011&nbsp;&nbsp;Wixun.com&nbsp;&nbsp;Inc.&nbsp;&nbsp;All&nbsp;Rights&nbsp;Reserved.&nbsp;&nbsp;&nbsp;&nbsp;蛙扑公司&nbsp;&nbsp;&nbsp;&nbsp;版权所有
</div>

</body>
</html>